const db = {
  save(key, value) {
    uni.setStorageSync(key, JSON.stringify(value))
  },
  get(key, defaultValue = {}) {
    return uni.getStorageSync(key) ? JSON.parse(uni.getStorageSync(key)) :  !defaultValue
  },
  remove(key) {
    uni.removeStorageSync(key)
  },
  clear() {
     uni.clearStorageSync()
  }
}

export default db
